package bupt.xixi.learning.test.bean;

import bupt.xixi.learning.beans.BeansException;
import bupt.xixi.learning.beans.factory.*;
import bupt.xixi.learning.context.ApplicationContext;
import bupt.xixi.learning.context.ApplicationContextAware;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

import java.util.Random;

@Slf4j
@Data
public class UserService implements IUserService{


    private BeanFactory beanFactory;
    private ApplicationContext applicationContext;

    private IUserDao userDao;
    private String company;
    private String location;

    @Override
    public void queryUserInfo(String uId) {
        try {
            Thread.sleep(new Random(1).nextInt(100));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        // log.info("查询用户信息: {}, 公司为【{}】, 地点为【{}】", userDao.queryUserName(uId), company, location);
        log.info("进入了queryUserInfo方法，因为没有自动注入userDao, 所以直接显示一下子～");
    }

}
